Xbasic

WIN_SPECIAL_FOLDER Function

Syntax

FolderPath as C = win_special_folder(C WindowsFolder )

Arguments

FolderPath

The path to the specified Windows special folder.

WindowsFolder

The name of one of the special folders listed in the table below or a NULL string if the folder does not exist.

Description

Returns the path to the Windows special folder specified

Discussion

The WIN_SPECIAL_FOLDER() function returns the path to the specified Windows special folder, such as the Desktop folder, the Start Menu folder, and the Personal Documents folder. Returns an empty string if the requested folder is not available or not valid. For example, Windows 95 does not have an AllUsersDesktop folder and returns an empty string if folder is specified as AllUsersDesktop. The following special folders are available:

Identifier

Folder Contents

AllUsersDesktop

Shortcuts that appear on the desktop for all users.

AllUsersStartMenu

Shortcuts that appear on the Start menu for all users.

AllUsersPrograms

Shortcuts that appear on the Programs menu for all users.

AllUsersStartup

Shortcuts to programs that are run on startup for all users.

Desktop

Shortcuts that appear on the desktop for the current user.

Favorites

Shortcuts saved as favorites by the current user.

Fonts

Fonts installed on the system.

MyDocuments

Current user's documents.

NetHood

Objects that appear in Network Neighborhood.

PrintHood

Printer links.

Recent

Shortcuts to current user's recently opened documents.

SendTo

Shortcuts to applications that show up as possible send-to targets when a user right-clicks on a file in Windows Explorer.

StartMenu

Shortcuts that appear in the current user's start menu.

Startup

Shortcuts to applications that run automatically when the current user logs on to the system.

Templates

Application template files specific to the current user.

Example

? win_special_folder("Desktop") 
= "C:\Documents and Settings\JDoe\Desktop" 

? win_special_folder("MyDocuments") 
= "C:\Documents and Settings\JDoe\My Documents" 

? win_special_folder("Fonts") 
= "C:\WINDOWS\Fonts" 

? win_special_folder("AllUsersDesktop") 
= "C:\Documents and Settings\All Users\Desktop"

See Also